import axios from '@/utils/request';

/**
 * 采购汇总统计
 */
 export async function QueryPurSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QueryPurSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 采购订单统计
 */
export async function QueryPurorderSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QueryPurorderSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 采购明细统计
 */
export async function QueryPurorderdetailSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QueryPurorderdetailSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}


/**
 * 销售产品统计
 */
export async function QuerySaleproductSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySaleproductSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}


/**
 * 销售明细(按产品)
 */
export async function QuerySaleproductdetailSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySaleproductdetailSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 销售订单跟踪表
 */
export async function QuerySaleOrderTrackByCondition(params) {
    const res = await axios.post('/Statistics/QuerySaleOrderTrackByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 销售客户统计
 */
export async function QuerySalecustomerSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySalecustomerSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 销售客户明细统计
 */
export async function QuerySalecustomerdetailSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySalecustomerdetailSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}
/**
 * 业务员提成汇总
 */
export async function QuerySalecommissionSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySalecommissionSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 业务员提成明细汇总
 */
export async function QuerySalecommissiondetailSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySalecommissiondetailSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 费用统计
 */
export async function QueryCostmanagerSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QueryCostmanagerSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}
/**
 * 费用明细统计
 */
export async function QueryCostmanagerDetailSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QueryCostmanagerDetailSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 销售出库单利润报表
 */
export async function QuerySaleOutorderProfitSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QuerySaleOutorderProfitSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}
/**
 * 利润报表
 */
export async function QueryProfitSummaryViewByCondition(params) {
    const res = await axios.post('/Statistics/QueryProfitSummaryViewByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}


